package com.vitabuybuy.tv.dto;

import com.vitabuybuy.tv.utils.LanaugeUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 作者：SimGa
 * 日期：2020/12/17
 * 时间：15:03
 * 包名：com.vitabuybuy.tv.dto
 */
public class OrderDetailDto {
    private double freightAmount;
    private double goodsAmount;
    private double discountAmount;
    private double paymentAmount;
    private double platformDiscount;
    private double storeDiscount;
    private String type;
    private String paymentTime;
    private String deliveryTime;
    private String receivingTime;
    private String paymentMethod;
    private String orderNumber;
    private String buyerRemark;
    private int remainingTime;
    private String consigneeName;
    private String createTime;
    private int goodsQuantity;
    private String consigneePhone;
    private int id;
    private String status;
    private String consigneeAddress;
    private OrderListDto.StoreBean store;

    public String getBuyerRemark() {
       return buyerRemark == null ? "" : buyerRemark;
    }

    public void setBuyerRemark(String buyerRemark) {
        this.buyerRemark = buyerRemark;
    }

    public double getPaymentAmount() {
        return paymentAmount;
    }

    public void setPaymentAmount(double paymentAmount) {
        this.paymentAmount = paymentAmount;
    }

    public double getPlatformDiscount() {
        return platformDiscount;
    }

    public void setPlatformDiscount(double platformDiscount) {
        this.platformDiscount = platformDiscount;
    }

    public double getStoreDiscount() {
        return storeDiscount;
    }

    public void setStoreDiscount(double storeDiscount) {
        this.storeDiscount = storeDiscount;
    }

    public OrderListDto.StoreBean getStore() {
        return store;
    }

    public void setStore(OrderListDto.StoreBean store) {
        this.store = store;
    }

    private List<OrderDetailDto> childList;

    public List<OrderDetailDto> getChildList() {
        return childList;
    }

    public void setChildList(List<OrderDetailDto> childList) {
        this.childList = childList;
    }

    public String getDeliveryTime() {
        return deliveryTime == null ? "" : deliveryTime;
    }

    public void setDeliveryTime(String deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public String getReceivingTime() {
        return receivingTime == null ? "" : receivingTime;
    }

    public void setReceivingTime(String receivingTime) {
        this.receivingTime = receivingTime;
    }

    public String getPaymentMethod() {
        return paymentMethod == null ? "" : paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public String getPaymentTime() {
        return paymentTime == null ? "" : paymentTime;

    }

    public void setPaymentTime(String paymentTime) {
        this.paymentTime = paymentTime;
    }

    public String getOrderNumber() {
        return orderNumber == null ? "" : orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    /**
     * amount : 5
     * product : {"thumbnail":"http://106.55.47.138/attachment/jpg/3007/137_14959.jpg","name":"airjordan1","id":12}
     * quantity : 5
     * price : 1
     * id : 13
     * specifications : {"EN":"white","ZH":"白色","MA":"putih"};{"EN":"M","ZH":"M","MA":"M"}
     */

    private List<ItemListBean> itemList;

    public double getFreightAmount() {
        return freightAmount;
    }

    public void setFreightAmount(double freightAmount) {
        this.freightAmount = freightAmount;
    }

    public double getGoodsAmount() {
        return goodsAmount;
    }

    public void setGoodsAmount(double goodsAmount) {
        this.goodsAmount = goodsAmount;
    }

    public double getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(double discountAmount) {
        this.discountAmount = discountAmount;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getRemainingTime() {
        return remainingTime;
    }

    public void setRemainingTime(int remainingTime) {
        this.remainingTime = remainingTime;
    }

    public String getConsigneeName() {
        return consigneeName;
    }

    public void setConsigneeName(String consigneeName) {
        this.consigneeName = consigneeName;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getGoodsQuantity() {
        return goodsQuantity;
    }

    public void setGoodsQuantity(int goodsQuantity) {
        this.goodsQuantity = goodsQuantity;
    }

    public String getConsigneePhone() {
        return consigneePhone;
    }

    public void setConsigneePhone(String consigneePhone) {
        this.consigneePhone = consigneePhone;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getConsigneeAddress() {
        String[] split = consigneeAddress.split(";");
        consigneeAddress = "";
        for (String spec : split) {
            String str = LanaugeUtils.returnStrByLocation(spec);
            consigneeAddress = consigneeAddress.concat(str).concat(";");
        }
        return consigneeAddress.isEmpty() ? consigneeAddress : consigneeAddress.substring(0, consigneeAddress.length() - 1);
    }

    public void setConsigneeAddress(String consigneeAddress) {
        this.consigneeAddress = consigneeAddress;
    }

    public List<ItemListBean> getItemList() {
        return itemList;
    }

    public void setItemList(List<ItemListBean> itemList) {
        this.itemList = itemList;
    }

    public static class ItemListBean implements Serializable {
        private double amount;
        /**
         * thumbnail : http://106.55.47.138/attachment/jpg/3007/137_14959.jpg
         * name : airjordan1
         * id : 12
         */

        private ProductBean product;
        private ProductBean goods;
        private int quantity;
        private double price;
        private int id;
        private String specifications;
        private List<VideoAndPicBean> fileBean;
        private int scores;
        private String content;
        private boolean issue;


        public static class VideoAndPicBean{
            private String tag;
            private String fileUrl;
            private String cover;

            public String getTag() {
                return tag;
            }

            public void setTag(String tag) {
                this.tag = tag;
            }

            public String getFileUrl() {
                return fileUrl;
            }

            public void setFileUrl(String fileUrl) {
                this.fileUrl = fileUrl;
            }

            public String getCover() {
                return cover == null ? "" : cover;
            }

            public void setCover(String cover) {
                this.cover = cover;
            }
        }


        public boolean isIssue() {
            return issue;
        }

        public void setIssue(boolean issue) {
            this.issue = issue;
        }

        public List<VideoAndPicBean> getFileBean() {
            if(fileBean == null){
                fileBean = new ArrayList<>();
            }
            return fileBean;
        }

        public void setFileBean(List<VideoAndPicBean> fileBean) {
            this.fileBean = fileBean;
        }

        public int getScores() {
            return scores;
        }

        public void setScores(int scores) {
            this.scores = scores;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public ProductBean getGoods() {
            return goods;
        }

        public void setGoods(ProductBean goods) {
            this.goods = goods;
        }

        public double getAmount() {
            return amount;
        }

        public void setAmount(double amount) {
            this.amount = amount;
        }

        public ProductBean getProduct() {
            return product;
        }

        public void setProduct(ProductBean product) {
            this.product = product;
        }

        public int getQuantity() {
            return quantity;
        }

        public void setQuantity(int quantity) {
            this.quantity = quantity;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getSpecifications() {
            String[] split = specifications.split(";");
            specifications = "";
            for (String spec : split) {
                String str = LanaugeUtils.returnStrByLocation(spec);
                specifications = specifications.concat(str).concat(";");
            }
            return specifications.isEmpty() ? specifications : specifications.substring(0, specifications.length() - 1);
        }

        public void setSpecifications(String specifications) {
            this.specifications = specifications;
        }

        public static class ProductBean implements Serializable {
            private String thumbnail;
            private String image;
            private String name;
            private int id;

            public String getImage() {
                return image;
            }

            public void setImage(String image) {
                this.image = image;
            }

            public String getThumbnail() {
                return thumbnail;
            }

            public void setThumbnail(String thumbnail) {
                this.thumbnail = thumbnail;
            }

            public String getName() {
                return LanaugeUtils.returnStrByLocation(name);
            }

            public void setName(String name) {
                this.name = name;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }
        }
    }
}
